package com.openapi.business;

import com.alibaba.fastjson.JSONObject;

import java.text.SimpleDateFormat;

public class RealtimeMediaUploadCmd extends DistributeEntity{
    /**
     * 通道号
     */
    public int chanelId;
    /**
     * 控制指令
     * 0关闭音视频
     * 1切换码流
     * 2暂停传输
     * 3恢复传输
     * 4关闭双向对讲
     */
    public int CmdType;
    /**
     * 关闭音视频类型
     * 0 关闭音视频
     * 1 只关闭音频 保留视频
     * 2 只关闭视频 保留音频
     */
    public int CloseMediaType;
    /**
     * 切换码流类型 0主码流 1子码流
     */
    public int ChangeCodeType;

    public JSONObject toJSONString()    {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        JSONObject object = new JSONObject();
        object.put("chanelId",chanelId);
        object.put("CmdType",CmdType);
        object.put("CloseMediaType",CloseMediaType);
        object.put("ChangeCodeType",ChangeCodeType);

        object.put("distributeMsgTopic",distributeMsgTopic);
        object.put("devNo",devNo);
        object.put("requestId",requestId);
        object.put("userId",userId);
        object.put("userName",userName);
        object.put("distributeTime",sdf.format(distributeTime));
        object.put("msgId",msgId);
        object.put("serialNo",serialNo);
        return object;
    }

}
